<template>
  <j-modal title="转诊信息" :width="800" :visible="visible" switchFullscreen @cancel="handleCancel" @ok="handleOk">
    <div class="box">
      <p><span>原治疗地区：</span>{{ infoObj.originRegionWords }}</p>
      <p><span>原治疗门诊：</span>{{ infoObj.originClinic }}</p>
      <p><span>拟转诊至：</span>{{ infoObj.targetRegionWords }}</p>
      <p><span>治疗门诊：</span>{{ infoObj.targetClinic }}</p>
      <p><span>病人编号：</span>{{ infoObj.patientId }}</p>
      <p><span>转诊申请时间：</span>{{ infoObj.referralApplyTime }}</p>
      <p><span>转诊级别：</span>{{ infoObj.referralLevel }}</p>
      <p><span>转诊事由概要：</span>{{ infoObj.referralCause }}</p>
      <p><span>治疗建议：</span>{{ infoObj.cureProposal }}</p>
      <p><span>现维持剂量：</span>{{ infoObj.curDose }}</p>
      <p><span>转诊时间：</span>{{ infoObj.startTime }} ~ {{ infoObj.endTime }}</p>
      <p><span>长期变更服药门诊：</span>{{ infoObj.isChange == '1' ? '短期' : '长期' }}</p>
    </div>
    <template slot="footer">
      <p style="text-align: left;">创建人：{{ infoObj.createBy }} <span style="margin-left:30px;">创建时间：{{ infoObj.createTime }}</span> </p>
    </template>
  </j-modal>
</template>
<script>
import * as treatApi from '@/api/sjsk/help/treat.js'
export default {
  name: 'detailModal',
  data() {
    return {
      visible: false,
      infoObj: {},
    }
  },
  async created() {
  },
  methods: {
    show(id) {
      this.visible = true
      this.getDetail(id)
    },
    getDetail(id) {
      console.log("id："+id)
      treatApi.getRecordById({ id: id }).then(res => {
        if (res.success) {
          this.infoObj = res.result ? res.result : {}
          if (this.infoObj.isChange === '1') {
            this.infoObj.isChange = '否';
          }else{
            this.infoObj.isChange = '是';
          }
        }
      }).catch((e) => {
        this.$message.warn('请求失败！')
      })
    },
    handleCancel() {
      this.visible = false
    },
    handleOk() {
      this.visible = false
    }
  },
}
</script>
<style lang="less" scoped>
.box {
  span {
    display: inline-block;
    width: 140px;
    text-align: left;
  }
}
</style>
